<template>
  <div>
    <div slot="header" class="clearfix">
      <span style="float: left; padding: 3px 0">红盘列表</span>
      <div class="btn-right">
        <el-button type="text" icon="el-icon-refresh">刷新</el-button>
        <el-button type="text" icon="el-icon-switch-button" @click="cancellation">注销</el-button>
      </div>
    </div>
    <div>
      <com-table :tableData="tableData" url="app" keyName="app" :has-data="hasData" :table-head-list="tableHeadList"
        :total-count="totalCount" :page-num="pageNum" :page-size="pageSize" :page-sizes="pageSizes"
        :table-loading="loading" :table-height="tableHeight" :is-show-select="true" :page-show="true"
        :handle-show="true" :merge-flag="false" :modifys="true" :baddtsd="false" @setSearchHeight="setTableHeight"
        @openDialog="openDialog" ref="comTable">
      </com-table>
    </div>
  </div>
</template>
<script>
import ComTable from "../../components/table/comTable";
export default {
  name: "terminalAccess",
  data() {
    return {
      pageNum: 1,
      pageSize: 10,
      pageSizes: [5, 10, 20, 100],
      totalCount: 0,
      // tableData: [
      //   { name: '11', company: '11', securityLevel: '11', serial: '11', model: '11', manufacturer: '11', describe: '11' }
      // ], // 表格数据
      tableData:[],
      options: [],
      value1: "",
      value3: "",
      tableHeight: "", // 表格高度
      dialogTitle: "",
      hasData: false,
      loading: false, // 数据加载状态遮罩
      infoForm: {},
      rules: {},
      checkList: [],
      tableHeadList: [
        { columnComment: "责任人", columnName: "name", },
        { columnComment: "单位名称", columnName: "company", },
        { columnComment: "密级", columnName: "securityLevel", },
        { columnComment: "红盘序列号", columnName: "serial", },
        { columnComment: "红盘型号", columnName: "model", },
        { columnComment: "厂商号", columnName: "manufacturer", },
        { columnComment: "口令剩余次数", columnName: "from", },
        { columnComment: "口令最大尝试次数", columnName: "from", },
        { columnComment: "描述", columnName: "describe", },
      ],
      dialogControl: false,
    };
  },
  components: {
    ComTable,
  },
  created() { },
  methods: {
    //新建与修改
    openDialog(type, row) {
      this.$router.push({
        path: '/redDiskForm',
        name:'redDiskForm',
        params: row
      });
    },
    setTableHeight() {
      let clientHeiht =
        window.innerHeight || document.documentElement.clientHeight;
      this.tableHeight = clientHeiht - 160;
    },
    cancellation() {
      this.$confirm('确认注销此设备！', '注销', {
        confirmButtonText: '是',
        cancelButtonText: '否',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '注销成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消注销'
        });
      });
    }
  },
};
</script>

<style scoped>
.anniushu {
  /* height: 80px;
  line-height: 80px; */
  text-align: right;
  margin-right: 50px;
}
.el-checkbox-group {
  display: flex;
  flex-direction: column;
}
.el-select {
  width: 100%;
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 100%;
}
.btn-right {
  display: inline-block;
  float: right;
}
</style>